package com.hnas.eastsquare.dao;

import org.springframework.stereotype.Component;

import com.hnas.core.dao.BaseDaoImpl;
import com.hnas.core.util.StringUtil;
import com.hnas.eastsquare.orm.SediToBalanceRecord;

@Component("sediToBalanceRecordDao")
public class SediToBalanceRecordDaoImpl extends BaseDaoImpl<SediToBalanceRecord> implements SediToBalanceRecordDao{

	public SediToBalanceRecordDaoImpl() {
		super(SediToBalanceRecord.class);
	}

	@Override
	public SediToBalanceRecord saveOrUpdate(SediToBalanceRecord vo) throws Exception {
		if(vo == null||StringUtil.isEmpty(vo.getId())) return null;
		SediToBalanceRecord entity = this.entityManager.find(SediToBalanceRecord.class, vo.getId());
		if(entity == null){
			this.entityManager.persist(vo);
		}else{
			this.entityManager.merge(vo);
		}
		return vo;
	}

}
